

from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *

# import resources

from selectionTools import InvertAction,ClearAction,AllAction,PolyAction,FreehandAction,CircleAction,Circle2Action

import doAbout

class MainPlugin(object):
  def __init__(self, iface):
    # Save a reference to the QGIS iface
    self.iface = iface

  def initGui(self):
    # Create action
    self.menu=QMenu("SelectPlus")

    self.invert = InvertAction(self.iface)
    self.clear = ClearAction(self.iface)
    self.all = AllAction(self.iface)
    self.poly = PolyAction(self.iface)
    self.free = FreehandAction(self.iface)
    self.circle = CircleAction(self.iface)
    self.circle2 = Circle2Action(self.iface)

    self.about = QAction("About SelectPlus",self.iface.mainWindow())
    QObject.connect(self.about,SIGNAL("triggered()"),self.clickAbout)

    self.menu.addActions([self.all,self.clear,self.invert,self.poly,self.free,self.circle,self.circle2])
    self.menu.addSeparator()
    self.menu.addAction(self.about)
    
    menuBar = self.iface.mainWindow().menuBar()
    menuBar.addMenu(self.menu)

  def clickAbout(self):
    d = doAbout.Dialog()
    d.exec_()

  def unload(self):
    # Remove the plugin
    pass


